/*
 *	rms.c
 *
 *	afp.exe
 *
 *	Audio Finger Print project
 */

float RMS(__int16* buff, int N)
{
	int i;

	float rms = 0;
	for(i = 0; i < N; ++i)
	{
		float x = buff[i] / 32767.0f;
		rms += x*x;
	}
	rms /= N;

	return rms;
}
